﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VswService_V7.Utility;

namespace VswService_V7.DataBase.Tables
{

    public partial class BLADE_INFO
    {
        #region field name 
        public static readonly string tableName = "BLADE_INFO";
        public static readonly string fd_bladeNo = "BLADE_NO";
        public static readonly string fd_bladeSn = "BLADE_SN";
        public static readonly string fd_bladeOd = "BLADE_OD";
        public static readonly string fd_bladeWt = "BLADE_WT";
        public static readonly string fd_bladeTn = "BLADE_TN";
        public static readonly string fd_cutArea = "BLADE_CUTAREA";
        public static readonly string fd_location = "BLADE_LOCATION";
        public static readonly string fd_updateTime = "UPDATE_TIME";
        #endregion

        /// <summary>
        /// inser a blade record
        /// </summary>
        /// <param name="blade"></param>
        public static void InsertBladeRecord(BladeInfo blade)
        {
            string sql = string.Format("insert into {0}" +
                "({1},{2},{3},{4}," +
                "{5},{6},{7}," +
                "{8})" +
                "values('{9}','{10}','{11}','{12}'," +
                "'{13}','{14}','{15}'," +
                "'{16}')",
                    tableName,
                    fd_bladeNo, fd_bladeSn, fd_bladeOd, fd_bladeWt,
                    fd_bladeTn, fd_cutArea, fd_location,
                    fd_updateTime,
                    blade.bladeNo, blade.bladeSn, blade.bladeOd, blade.bladeWt,
                    blade.bladeTn, blade.blade_area, blade.blade_location,
                    blade.updateTime);
            try
            {
                OracleHelper.Exct_NonQuery(sql);
            }
            catch (Exception ex)
            {
                LogHelper.WriteLog("InsertBladeRecord", ex);
                throw ex;
            }

        }
    }

    public class BladeInfo
    {
        public BladeInfo(string bladeNumber)
        {
            bladeNo = bladeNumber;
            bladeSn = "0";
            bladeOd = "0";
            bladeWt = "0";
            bladeTn = "0";
            blade_area = "0";
            blade_location = "0";
            updateTime = "0";
        }
        public string bladeNo;
        public string bladeSn;
        public string bladeOd;

        public string bladeWt;
        public string bladeTn;
        public string blade_area;

        public string blade_location;
        public string updateTime;

    }




}
